#!/usr/bin/python3.8.9
# -*- coding: utf-8 -*-

# @Author  : Tina Yu
# @Time    : 2022-5-4 11:55
from homework.task_api.base.base_api import BaseApi


class WeCowork(BaseApi):
    def get_access_token(self, corp_id, corp_secret):
        """获取token"""
        url = '/gettoken'

        params = {
            'corpid': corp_id,
            'corpsecret': corp_secret,
        }
        r = self.send('GET', url, params=params)
        return r.json()['access_token']

        # todo 获取到token后，保存到文件中
